IntentBuilder

open class IntentBuilder(source)

IntentBuilder is a helper for constructing ACTION_SEND and ACTION_SEND_MULTIPLE sharing intents and starting activities to share content. The ComponentName and package name of the calling activity will be included.

Constructors

Link copied to clipboard
constructor(@NonNull launchingContext: @NonNull Context)
Create a new IntentBuilder for launching a sharing action from launchingContext.

Functions

Link copied to clipboard
@NonNull
open fun addEmailBcc(@NonNull address: @NonNull String): @NonNull ShareCompat.IntentBuilder
Add an email address to be used in the "bcc" field of the final Intent.
@NonNull
open fun addEmailBcc(addresses: @NonNull Array<String>): @NonNull ShareCompat.IntentBuilder
Add an array of email addresses to be used in the "bcc" field of the final Intent.
Link copied to clipboard
@NonNull
open fun addEmailCc(@NonNull address: @NonNull String): @NonNull ShareCompat.IntentBuilder
Add an email address to be used in the "cc" field of the final Intent.
@NonNull
open fun addEmailCc(addresses: @NonNull Array<String>): @NonNull ShareCompat.IntentBuilder
Add an array of email addresses to be used in the "cc" field of the final Intent.
Link copied to clipboard
@NonNull
open fun addEmailTo(@NonNull address: @NonNull String): @NonNull ShareCompat.IntentBuilder
Add an email address to be used in the "to" field of the final Intent.
@NonNull
open fun addEmailTo(addresses: @NonNull Array<String>): @NonNull ShareCompat.IntentBuilder
Add an array of email addresses to be used in the "to" field of the final Intent.
Link copied to clipboard
@NonNull
open fun addStream(@NonNull streamUri: @NonNull Uri): @NonNull ShareCompat.IntentBuilder
Add a stream URI to the data that should be shared.
Link copied to clipboard
@NonNull
open fun createChooserIntent(): @NonNull Intent
Create an Intent that will launch the standard Android activity chooser, allowing the user to pick what activity/app on the system should handle the share.
Link copied to clipboard
@NonNull
open fun from(@NonNull launchingActivity: @NonNull Activity): @NonNull ShareCompat.IntentBuilder
Create a new IntentBuilder for launching a sharing action from launchingActivity.
Link copied to clipboard
@NonNull
open fun getIntent(): @NonNull Intent
Retrieve the Intent as configured so far by the IntentBuilder.
Link copied to clipboard
@NonNull
open fun setChooserTitle(@StringRes resId: Int): @NonNull ShareCompat.IntentBuilder
@NonNull
open fun setChooserTitle(@Nullable title: @Nullable CharSequence): @NonNull ShareCompat.IntentBuilder
Set the title that will be used for the activity chooser for this share.
Link copied to clipboard
@NonNull
open fun setEmailBcc(addresses: @Nullable Array<String>): @NonNull ShareCompat.IntentBuilder
Set an array of email addresses to BCC on this share.
Link copied to clipboard
@NonNull
open fun setEmailCc(addresses: @Nullable Array<String>): @NonNull ShareCompat.IntentBuilder
Set an array of email addresses to CC on this share.
Link copied to clipboard
@NonNull
open fun setEmailTo(addresses: @Nullable Array<String>): @NonNull ShareCompat.IntentBuilder
Set an array of email addresses as recipients of this share.
Link copied to clipboard
@NonNull
open fun setHtmlText(@Nullable htmlText: @Nullable String): @NonNull ShareCompat.IntentBuilder
Set an HTML string to be sent as part of the share.
Link copied to clipboard
@NonNull
open fun setStream(@Nullable streamUri: @Nullable Uri): @NonNull ShareCompat.IntentBuilder
Set a stream URI to the data that should be shared.
Link copied to clipboard
@NonNull
open fun setSubject(@Nullable subject: @Nullable String): @NonNull ShareCompat.IntentBuilder
Set a subject heading for this share; useful for sharing via email.
Link copied to clipboard
@NonNull
open fun setText(@Nullable text: @Nullable CharSequence): @NonNull ShareCompat.IntentBuilder
Set the literal text data to be sent as part of the share.
Link copied to clipboard
@NonNull
open fun setType(@Nullable mimeType: @Nullable String): @NonNull ShareCompat.IntentBuilder
Set the type of data being shared
Link copied to clipboard
open fun startChooser()
Start a chooser activity for the current share intent.